var cc__decorate = __decorate;
Object.defineProperty(exports, "__esModule", {
  value: true
});
var $2BulletMgr = require("BulletMgr");
var $2ExcelManager = require("ExcelManager");
var $2PoolManager = require("PoolManager");
var $2SceneStage = require("SceneStage");
var cc__decorator = cc._decorator;
var ccp_ccclass = cc__decorator.ccclass;
var ccp_property = cc__decorator.property;
var def_TombStone = /* */function (_cc$Component76) {
  babel_inherits(d, _cc$Component76);
  var _super92 = babel_createSuper(d);
  function d() {
    var _this212;
    babel_classCallCheck(this, d);
    _this212 = _super92.apply(this, arguments);
    _this212.state = 1;
    _this212._hp = 0;
    return _this212;
  }
  babel_createClass(d, [{
    key: "hp",
    get() {
      return this._hp;
    },
    set(e) {
      var _this213 = this;
      this._hp = e;
      if (2 != this.state && this._hp / this.allHp < .65 && this._hp / this.allHp > .3) {
        this.state = 2;
        this.node.getComponent(sp.Skeleton).setAnimation(0, "2liekai", false);
      } else if (3 != this.state && this._hp / this.allHp < .3 && this._hp / this.allHp > 0) {
        this.state = 3;
        this.node.getComponent(sp.Skeleton).setAnimation(0, "3liekai", false);
      } else if (this.hp <= 0) {
        this.node.getComponent(cc.BoxCollider).enabled = false, this.node.getComponent(sp.Skeleton).setAnimation(0, "4liekai", false), this.node.getComponent(sp.Skeleton).setCompleteListener(function () {
          _this213.node.getComponent(sp.Skeleton).setCompleteListener(null);
          _this213.scheduleOnce(function () {
            $2SceneStage.default.instance.delPlantInBlckArr(_this213.row, _this213.col);
            $2PoolManager.default.instance.putPoolNode(_this213.node);
          }, 1);
        });
      }
    }
  }, {
    key: "onLoad",
    value: function onLoad() {
      this.allHp = $2ExcelManager.ExcelMgr.instance.GetExcelObject($2ExcelManager.TableName.zombieTable)[99].hp;
    }
  }, {
    key: "init",
    value: function init(e, t) {
      this.row = e;
      this.col = t;
      this.node.getComponent(cc.BoxCollider).enabled = true;
      this.hp = $2ExcelManager.ExcelMgr.instance.GetExcelObject($2ExcelManager.TableName.zombieTable)[99].hp;
      this.state = 1;
      this.node.scale = $2ExcelManager.ExcelMgr.instance.GetExcelObject($2ExcelManager.TableName.zombieTable)[99].scale;
      this.node.getComponent(sp.Skeleton).setAnimation(0, "1maochu", false);
    }
  }, {
    key: "hurt",
    value: function hurt(e, t, a) {
      this.hp -= e;
      if ("" != t && t) {
        var _e125 = $2BulletMgr.default.instance().getEffect(t);
        _e125.scale = a;
        _e125.parent = this.node;
        _e125.x = 0;
        _e125.y = 50;
        var _n61 = _e125.getComponent(sp.Skeleton);
        _n61.setAnimation(0, "newAnimation", false);
        _n61.setCompleteListener(function () {
          _n61.setCompleteListener(null);
          _e125.scale = 1;
          $2BulletMgr.default.instance().removeEffect(_e125);
        });
      }
    }
  }]);
  return d;
}(cc.Component);
def_TombStone = cc__decorate([ccp_ccclass], def_TombStone);
exports.default = def_TombStone;